package com.lx.sync.core.model;

import lombok.Data;

import java.util.Date;

@Data
public class SyncFetchDataRequest {
    /**
     * 更新时间
     */
    private Date updtTime;

    /**
     * 分页模式：1-游标分页，2-偏移分页
     */
    private Integer pageMode = 2;

    /**
     * 游标分页参数
     */
    private Long lastId;

    /**
     * 偏移分页参数
     */
    private Integer pageNum;
    private Integer pageSize;

    /**
     * 是否查询总数
     */
    private Boolean queryCount;

    public SyncFetchDataRequest(Date updtTime, Integer pageNum, Integer pageSize, Boolean queryCount) {
        this.updtTime = updtTime;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.queryCount = queryCount;
    }

    public SyncFetchDataRequest(Date updtTime, Long lastId, Integer pageSize) {
        this.updtTime = updtTime;
        this.pageMode = 1;
        this.lastId = lastId;
        this.pageSize = pageSize;
        this.queryCount = false;
    }
}

